# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do
  desc "Push a new release build to the App Store"
  lane :release do
    increment_build_number(xcodeproj: "rzc_app.xcodeproj")
    build_app(workspace: "rzc_app.xcworkspace", scheme: "rzc_app")
    upload_to_app_store(skip_metadata: true, skip_screenshots: true)
  end
end

platform :ios do
  desc "Push a new release build to the firim"
  lane :to_firim do
    # add actions here: https://docs.fastlane.tools/actions
    build_app(
	    workspace: "rzc_app.xcworkspace",
      scheme: "rzc_app",
      configuration: "Release",
      include_symbols: "false",
      export_options: {
        destination: "export",
        method: "development",
        thinning: "<none>",
        signingStyle: "manual",
        signingCertificate: "iPhone Developer: 磊 孙 (UC324W2L69)",
        provisioningProfiles: { 
          "com.renzhichu.app" => "ios_development"
        }
      },
      output_directory: "../dist/firim",
      silent: true,
      output_name: "rzc_app.ipa",
    )
    firim(firim_api_token: "c2bf62d7c640d2a533e661c65555af21")
  end
end
